import React from 'react'
import { Modal} from 'antd'
import Table from '../../components/Table'
import 'whatwg-fetch'
import API from '../../axios/api'

require('es6-promise').polyfill();

const columns = [
    { dataIndex: 'LabelName', title: '标签名称', width: 200,},
    { dataIndex: 'LabelCount', title: '标记次数', width: 200,},
]

export default class ArticleDetailList extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            tData:[],
            loading: false,
        }
    }
    componentWillReceiveProps(nextProps, nextContext) {

    }

    render() {
        const {
            modalKey,
            visible,
            title,
            onCancel,
            width,
        } = this.props

        let tData = this.props.data.UserLabelList
        return (
            <Modal
                wrapClassName="form"
                key={modalKey}
                visible={visible}
                title={title}
                onCancel={onCancel}
                footer={null}
                width={width}
            >
            <div id="wrap">
                <div className="tableBox">
                    <div style={{ paddingTop: 10 }}>
                        <Table
                            onCtrlClick={ this.tableAction }
                            pagination={ true }
                            pageSize={10}
                            header={ columns }
                            data={tData}
                            loading={ this.state.loading }
                            scroll={{y: 385 }}
                        />
                    </div>
                </div>
            </div>
            </Modal>
        )
    }
}
